/**
 * Created by zhengsenwen on 2017/8/19.
 */


/**  第一次加载，让footer先隐藏，N毫秒后出现在页面最底部  */
function loadCopyrightFirst() {
    setTimeout(function () {
        var copyright = $("#copyright");
        var contentHeight =
            Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
        copyright.css({
            "visibility": "visible",
            //比实际的网页内容高度多加100px，留点儿空隙
            "margin-top": contentHeight + 100
        })
    }, 3000);

}

/**  ajax刷新，改变copyright距离顶部高度  */
function loadCopyrightSecond() {
    setTimeout(function () {
        var copyright = $("#copyright");
        var height = copyright.height();
        var contentHeight =
            Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
        copyright.css({
            "visibility": "visible",
            //每次都减去copyright的高度，页面高度变化只跟内容高度有关
            "margin-top": contentHeight - height
        })
    }, 3000);

}


/** diningroom.html中菜品手风琴伸缩变化后，页面高度发生变化，需要改变copyright距离顶部高度  */
function loadCopyright(countHeight) {
    setTimeout(function () {
        var copyright = $("#copyright");
        var height = copyright.height();
        var contentHeight =
            Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
        //alert(contentHeight+" - "+height+" - "+countHeight+" = "+(contentHeight - height - countHeight));
        copyright.css({
            "visibility": "visible",
            //每次都减去copyright的高度 以及ul手风琴伸缩的高度
            "margin-top": contentHeight - height - countHeight
        })
    }, 200);

}